import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import bus from "./bus"; 

     // 引入后进行初始化
    //  import Aegis from 'aegis-web-sdk';
      
    //  const aegis = new Aegis({
    //      id: '1kJp7rNkwbYkNoX6em', // 上报 id
    //      uin: 'xxx', // 用户唯一 ID（可选）
    //      reportApiSpeed: true, // 接口测速
    //      reportAssetSpeed: true, // 静态资源测速
    //      spa: true // spa 应用页面跳转的时候开启 pv 计算
    //  });


// 事件总控
Vue.prototype.$bus = bus;
// 图表

import echarts from "echarts";
console.log(echarts);
Vue.prototype.$echarts = echarts; 


// ui框架
import ElementUI from "element-ui";

// import 'element-ui/lib/theme-chalk/index.css';
import "./element-variables.scss";
Vue.use(ElementUI, { size: "mini" });

import { ElementTiptapPlugin } from "element-tiptap";
// import element-tiptap 样式
import "element-tiptap/lib/index.css";
Vue.use(ElementTiptapPlugin, { lang: "zh" });

// 动画样式表
import animated from "animate.css";
Vue.use(animated);

import Api from "@/api";
Vue.config.productionTip = false;
Vue.prototype.$showTips = function(msg, type = "success") {
  this.$message({
    message: msg,
    type: type,
  });
};
Vue.prototype.$checking = function(val, msg) {
  if (!val) {
    return this.$message({
      message: msg,
      type: "error",
    });
  }
};
Vue.prototype.$myCallBack = function(res, msg, cb) {
  if (res.code == 1) {
    cb()
    this.$message({
      message: msg,
      type: "success",
    }); 
  } else {
    this.$message({
      message: res.msg,
      type: "error",
    });
  }
};
Vue.prototype.$api = Api;
Vue.prototype.$$router = router; 


new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");
